<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:if test="${articals.numberOfElements != 0}">
	<c:forEach items="${articals.content}" var="artical">
		<article class="post">
			<div class="post-head">
				<h1 class="post-title">
					<a href="artical/${artical.id}">${artical.title}</a>
				</h1>
				<div class="post-meta">
					<span class="author">作者：<a href="author/${artical.author }">${artical.author.userName }</a></span> •
					<time class="post-date">${artical.date }</time>
				</div>
			</div>
			<div class="post-content">
				<p>${artical.introduction }</p>
			</div>
			<div class="post-permalink">
				<a href="artical/${artical.id}" class="btn btn-default">阅读全文</a>
			</div>

			<footer class="post-footer clearfix">
				<div class="pull-left tag-list">
					<i class="fa fa-folder-open-o"></i>
					<c:forEach items="${artical.categories}" var="category">
						<a href="category/${category.content}">${category.content}</a>
					</c:forEach>
				</div>
				<div class="pull-right share"></div>
			</footer>
		</article>
	</c:forEach>

	<nav class="pagination" role="navigation">
		<c:if test="${articals.number != 0}">
			<a class="newer-posts" href="category/${keyword }/${articals.number}"><i class="fa fa-angle-left"></i></a>
		</c:if>
		<span class="page-number">第 ${articals.number + 1} 页 ⁄ 共 ${articals.totalPages} 页</span>
		<c:if test="${articals.number + 1 < articals.totalPages}">
			<a class="older-posts" href="category/${keyword }/${articals.number + 2 }"><i class="fa fa-angle-right"></i></a>
		</c:if>
	</nav>
</c:if>
<c:if test="${articals.numberOfElements == 0}">
	<h1 class="text-center">啥也没找到 /(ㄒoㄒ)/~~</h1>
</c:if>